/*
 * @Author: 陈俊升 761723995@qq.com
 * @Date: 2023-05-11 18:11:41
 * @LastEditors: 陈俊升 761723995@qq.com
 * @LastEditTime: 2024-01-09 15:02:52
 * @FilePath: /hr_new_vue3/src/apis/management/human/humanChange/leave/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/* 人事-人事管理-实习管理api */

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
// const baseURL = env.VITE_API_BASE_URL;
const baseURL = env.VITE_DEV_BASE_URL;
const baseURL2 = env.VITE_APP_BASE_URL;

// 发起实习评价
export function PostInternshipEvaluationHuman(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/use',
    method: 'post',
    baseURL: baseURL,
    data
  });
}

// 编辑实习评价
export function PutInternshipEvaluationHuman(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/use',
    method: 'put',
    baseURL: baseURL,
    data
  });
}

// 获取员工实习评价详情
export function GetInternshipEvaluationHumanDetail(params: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/use',
    method: 'get',
    baseURL: baseURL,
    params
  });
}

// 编辑实习评价
export function ChangeInternshipEvaluationHumanStatus(data: {
  id: number;
  status: 0 | 1 | 2 | 3 | 4 | 5; //0待创建 1待发起 2代自评  3代他评 4已完成
}) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/use/status',
    method: 'put',
    baseURL: baseURL,
    data
  });
}

/**
 * // 删除员工实习评价
 * type： 1最外层列表 2内层实习指标表格 3内层自定义实习评价 4评分人
 */
export function DelInternshipEvaluationHumanDetail(data: {
  ids: number[];
  type: 1 | 2 | 3 | 4;
}) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/template/use',
    method: 'delete',
    baseURL: baseURL,
    data
  });
}

/**
 * // 获取评分人评价任务列表
 * type： 1待评价 2已评价
 */
export function GetInternshipEvaluationScorerList(params: {
  id: number;
  type: 1 | 2;
}) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/personnel_settings/lnternship_settings/Internship_Index_library/rater',
    method: 'get',
    baseURL: baseURL,
    params
  });
}
